// pages/my/my.js
import Toast from '@vant/weapp/toast/toast'
import Dialog from '@vant/weapp/dialog/dialog';
var data2 = require('../../utils/data.js');

Page({

    /**
     * 页面的初始数据
     */
    data: {
        show: false,
        list:data2.getuserimg(),
        imgurl:"/images/user.png",
        imgpack:"",

    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function () {
      var that = this;
      wx.getStorage({
        key: 'username',
        success (res) {
          console.log(res.data)
          that.setData({
            username: res.data
          })
        }
      })
        this.setData({
            
        })
    },
    getUserInfo(event) {
        console.log(event.detail);
    },
    onClose() {
        this.setData({
            show: false
        });
    },
    onClickIcon(){
        this.setData({
          show:true
        })
      },
      choiceimg(e){
        this.setData({
            imgpack:e.currentTarget.dataset.hi,
            // imgborder:"1px solid bule"
        })
      },
      onSure(){
          this.setData({
              imgurl:this.data.imgpack
          })
      },
      openaddr(){
          wx.navigateTo({
            url: '../address/address',
          })
      },
      openser(){
          wx.navigateTo({
            url: '../cusservice/cusservice',
          })
      },
      openhelp(){
          wx.navigateTo({
            url: '../help/help',
          })
      },
      tocollect(){
          wx.navigateTo({
            url: '../collect/collect',
          })
      }

})